package filewriter;

import java.io.*;

public class FilewriterUebung3 {
	

	public static void main(String[] args) throws IOException {
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(
				System.in));
				
		String s;
		
		System.out.println("Parameter:");
		String param = stdin.readLine();
		
		int zaehler = 0; 
        
		BufferedReader br = new BufferedReader(
				new FileReader("R:\\Transfer\\DQI09\\Informatik\\DQI09.txt"));

		
		while ((s = br.readLine()) != null) {
			
			
			
			int indexof = s.indexOf(param);
						
			while (indexof != -1)
			{
				s = s.substring(indexof+1);
				
				indexof = s.indexOf(param);
				zaehler++;
				
				
			}
			 
			
			

		}
		
		System.out.println("Anzahl:" + zaehler);
		br.close();


	}

}
